home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Magnum One
/
Magnum One (Mid-American Digital) (Disc Manufacturing).iso
/
d18
/
ttt5.arc
/
DEMO5.EXE
/
lha
/
KEYDEM1.PAS
< prev
next >
Wrap
Pascal/Delphi Source File
|
1989-01-31
|
1KB
|
43 lines
Program KeyTTT5_Demo_1;
{demostrates the use of user hooks}
Uses CRT, FASTTTT5, KeyTTT5, StrnTTT5, MiscTTT5;
var Ch : char;
Procedure Halt_program;
{this procedure will be called by the pressed-hook procedure when F10 is pressed}
begin
ClearText(1,1,80,25,white,black);
WriteAT(1,1,white,black,'Run DemoTTT.exe for the main demo program');
WriteAT(1,2,white,black,'Technojock''s Turbo Toolkit v5.0');
GotoXY(1,5);
Halt;
end;
{$F+} {VERY IMPORTANT must make procedures "FAR"}
Procedure Show_Clock;
begin
WriteAt(65,1,white,red,' '+Time+' ');
end;
Procedure Check_Pressed_Keys(var Ch : char);
begin
If Ch = #196 then {F10}
Halt_program;
end;
{$F-}
begin
FBox(1,1,80,25,white,red,2);
WriteCenter(1,yellow,red,' Key Hooks Demo - TTT 5.0 ');
WriteCenter(25,lightgray,red,' Press any key, or F10 to exit ');
WriteAt(15,13,white,red,'The Toolkit value of the pressed key is ');
Assign_Pressed_Hook(Check_Pressed_keys);
Assign_Idle_Hook(Show_Clock);
Repeat
Ch := GetKey;
WriteAt(55,13,yellow,red,Int_to_Str(Ord(Ch))+' ');
Until true = false; {a long time!};
end.